struct Droppable {
    name: &'static str,
}
// 这个简单的`drop`实现添加了打印到控制台的功能
impl Drop for Droppable {
    fn drop(&mut self) {
        println!("> Dropping {}", self.name);
    }
}
fn main() {
    let _a = Droppable { name: "a" };
//     代码块A
    {
        let _b = Droppable { name: "b" };
    //     代码块B
        {
            let _c = Droppable { name: "c" };
            let _d = Droppable { name: "d" };
            println!("Exiting block B");
        }
        println!("Just exited block B");
        println!("Exiting block A");
    }
    println!("Just exited block A");
//     变量可以手动调用`drop`函数来丢弃
    drop(_a);
//     试一试^将此行代码注释掉
    println!("end of the main function");
//     `_a`不会在这里被丢弃，因为它已经被手动丢弃了
}
